<?php
/**
 * 商品管理
 *
 *
 *
 *
 
 */
defined('InShopNC') or exit('Access Invalid!');

class keyModel extends Model{
    public function __construct(){
        parent::__construct('key');
    }
    
    public function getKeyList($condition=array()){
        $sql="select  key_word,count(key_id) as key_count from lxs_key where key_time > ".$condition['start']." and  key_time < ".$condition['end']." group by ( key_word)  order by key_count desc";
        return Model()->query($sql);
        //return $this->where($condition)->limit(false)->group('key_word')->select();
    }
    
    public function getOneKey($conditon){
        return $this->where($conditon)->find();
    }
    public function getKeyDetail($conditon){
        return $this->where($conditon)->select();
    }
    
    public function saveKey($data){
        return $this->insert($data);
    }
    
    public function editKey($condition,$update){
       return  $this->where($condition)->update($update);
    }
    
    public function delKey($condition){
        return $this->where($condition)->delete();
    }
    
    
}